<%@ page import="cn.edu.hbcit.text1.StudentDb" %>
<%@ page import="java.sql.ResultSet" %>
<%@ page import="java.util.List" %>
<%@ page import="cn.edu.hbcit.text1.Student" %><%--
  Created by IntelliJ IDEA.
  User: 11507
  Date: 2019/6/20
  Time: 10:59
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>$Title$</title>
</head>
<body>
<div class="container">

    <%@include file="template/header.jsp" %>

    <%--    <form action="addStu.jsp">--%>
    <%--      <input >--%>
    <%--      <button type="submit"></button>--%>
    <%--    </form>--%>

    <h2>查找信息如下</h2>
    <p>请选择您要修改数据的那个学生</p>
    <table class="table table-striped">
        <thead>
        <tr>
            <th>学号</th>
            <th>姓名</th>
            <th>年龄</th>
            <th>性别</th>
            <th>专业</th>
            <th>班级</th>
            <th>籍贯</th>
        </tr>
        </thead>
        <tbody>
            <%
        ServletContext context =(ServletContext)request.getServletContext();
        String acountNumber = (String) context.getAttribute("acountNumber");
        String name = request.getParameter("name_3");
        List<Student> list = StudentDb.selName(acountNumber,name);
        for (Student stu:list) {
        out.print("<tr>");
        out.print("<td>");
        out.print(stu.getStuId());
        out.print("</td>");
        out.print("<td>");
        out.print(stu.getStuMame());
        out.print("</td>");
        out.print("<td>");
        out.print(stu.getStuAge());
        out.print("</td>");
        out.print("<td>");
        out.print(stu.getStuSex());
        out.print("</td>");
        out.print("<td>");
        out.print(stu.getStuMajor());
        out.print("</td>");
        out.print("<td>");
        out.print(stu.getStuClass());
        out.print("</td>");
        out.print("<td>");
        out.print(stu.getStuNation());
        out.print("</td>");
        out.print("</tr>");

        out.print("<div class=\"card\">\n" +
"      <div class=\"card-body\">\n" +
"        <h4 class=\"card-title\">"+stu.getStuMame()+"</h4>\n" +
"        <p class=\"card-text\"> "+"学号为："+stu.getStuId()+"姓名为："+stu.getStuMame()+"</p>\n" +
"        <a href=\"alterStu.jsp?id="+stu.getStuId()+"&name="+stu.getStuMame()+"&year="+stu.getStuAge()+"&sex="+stu.getStuSex()+"&major="+stu.getStuMajor()+"&class="+stu.getStuClass()+"&nation="+stu.getStuNation()+"&place="+stu.getStuNativePlace()+"\"+"+"class=\"card-link\">修改</a>\n" +
"      </div>\n" +
"    </div>");

      }
    %>

        <%@include file="template/footer.jsp" %>


</div>
<%@include file="template/link.jsp" %>


<script>
    function getSearchValue() {
        var inputValue = document.getElementById('search').value;
        alert(inputValue);
        document.getElementById('search').name = inputValue;
    }

    // var getStr = alterStu.jsp ? id = 300003 & name = 可乐 & year = 30 & sex = 男 & major = 软件技术 & class = 软件技术 & nation = 汉族 & place = 河北;

</script>
</body>
</html>
